<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>邮件模版-<?php echo $cfg_sitename."-".$cfg_sysversion;?></title>
<meta property="xn:admins" content="583870616"/>
<meta property="wb:webmaster" content="ye-shi-li@qq.com">
<link href="templets/css/admin_css.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../inc/js/calenderJS.js"></script>
<script>
function checksubmit(){
if (document.getElementById('title').value=="") {
	window.alert("标题不能为空！！");
	document.getElementById('title').focus();		
	 return (false);
}

if (document.getElementById('content').value=="") {
	window.alert("内容不能为空！！");
	document.getElementById('content').focus();		
	 return (false);
}
    return true;
}
</script>
<script charset="utf-8" src="../inc/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="../inc/kindeditor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
    editor = K.create('#content', {
        resizeType : 1,
        allowImageRemote : true,
		uploadJson : 'admin_upload.php?act=upload&uid=<?php echo $_SESSION["id"]?>&typeid=eid&eid=<?php echo $_GET["id"];?>',
		allowFileManager : true,
        width : '100%',
        height : '400%',
        afterBlur : function(){this.sync();}//需要添加的
    });
});
</script>
</head>
<body>
<?php
if($act == "add"){
?>
<table width="98%" height="326" border="0" cellpadding="3" cellspacing="1" class="ye">
  <form name="myform" method="post" action="admin_email_ok.php?act=add" onSubmit="return checksubmit();">
    <tr>
      <td height="24" colspan="2" bgcolor="#666666"><font color="#FFFFFF">&nbsp;<strong>添加邮件模版</strong></font></td>
    </tr>
    <tr>
      <td width="13%" height="24" align="right" valign="middle" bgcolor="#f1f1f1">模版标题：</td>
      <td width="87%" height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input name="title" type="text" id="title" size="50" class="yeshili"/></td>
    </tr>
    <tr>
      <td align="right" valign="middle" bgcolor="#f1f1f1"><span class="l_col">模版内容：</span></td>
      <td align="left" valign="middle" bgcolor="#f1f1f1"><textarea name="content" id="content"></textarea></td>
    </tr>
    <tr>
      <td height="24" bgcolor="#f1f1f1">&nbsp;</td>
      <td height="24" bgcolor="#f1f1f1"><input type="submit" name="button" id="button" value="添加" class="button"/> <input type="button" name="back" id="back" value="返回" onclick="javascript:window.history.go(-1);" class="button"/></td>
    </tr>
  </form>
</table>
<?php
}
if($act == "mod"){
	$sql = get_sql("select * from {pre}email where id=".$id." order by id");
	$list = $db->getonerow($sql);
?>
<table width="98%" height="326" border="0" cellpadding="3" cellspacing="1" class="ye">
  <form name="myform1" method="post" action="admin_email_ok.php?act=mod" onSubmit="return checksubmit();">
    <tr>
      <td height="24" colspan="2" bgcolor="#666666"><font color="#FFFFFF">&nbsp;<strong>修改邮件模版</strong></font></td>
    </tr>
    <tr>
      <td width="13%" height="24" align="right" valign="middle" bgcolor="#f1f1f1">模版标题：</td>
      <td width="87%" height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input name="title" type="text" id="title" value="<?php echo $list['title'];?>" size="50" class="yeshili"/></td>
    </tr>
    <tr>
      <td align="right" valign="middle" bgcolor="#f1f1f1"><span class="l_col">模版内容：</span></td>
      <td align="left" valign="middle" bgcolor="#f1f1f1"><textarea name="content" id="content"><?php echo $list['content']?></textarea></td>
    </tr>
    <tr>
      <td height="24" bgcolor="#f1f1f1">&nbsp;</td>
      <td height="24" bgcolor="#f1f1f1">
      <input type="hidden" name="id" value="<?php echo $list['id']; ?>">
      <input type="submit" name="modbtn" id="modbtn" value="修改" class="button"/> <input type="button" name="back" id="back" value="返回" onclick="javascript:window.history.go(-1);" class="button"/></td>
    </tr>
  </form>
</table>
<?php
}
?>
</body>
</html>